package com.tz.bean;

import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * Created by longquan on 2016-10-9.
 */
@Component
//@Lazy
public class ClassA {

   // @Autowired
    private ClassB b;

  //  @Autowired
    private ClassD d;


    public ClassA() {
        System.out.println("空参构造");
    }

    /**@Autowired
    public ClassA(ClassB b, ClassD d) {
        System.out.println("有参构造");
        this.b = b;
        this.d = d;
    }**/

    public ClassB getB() {
        return b;
    }
   @Autowired
    public void setB(ClassB b) {
        this.b = b;
    }

    public ClassD getD() {
        return d;
    }
    @Autowired
    public void setD(ClassD d) {
        this.d = d;
    }

    public void m(){

        System.out.println("a.m()的运行代码");
        d.m();
    }


}
